Skip to content

test: add k6 load testing, E2E tests, fuzz testing, and Pact contract tests#883

Merged
KingFRANKHOOD merged 6 commits into
KingFRANKHOOD:mainfrom
Sundriveauto:testing-suite
Jun 30, 2026
Merged

test: add k6 load testing, E2E tests, fuzz testing, and Pact contract tests#883
KingFRANKHOOD merged 6 commits into
KingFRANKHOOD:mainfrom
Sundriveauto:testing-suite

Conversation

@Sundriveauto

@Sundriveauto Sundriveauto commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Closes #786
Closes #787
Closes #788
Closes #789

Summary

Adds four new testing capabilities: k6 load testing, Playwright E2E, contract fuzz testing with QuickCheck, and Pact consumer-driven contract tests.

Commits

  1. 051e122 - feat: add k6 load testing suite
  2. 2fab8e0 - test: add E2E Playwright tests for critical user flows
  3. 4eb53dd - test: add comprehensive fuzz testing for escrow contract
  4. 8ac4b2e - feat: implement Pact consumer-driven contract tests

…mission simulation

- k6/load-test.js: simulates full trade lifecycle under concurrent load (create,
  list, deposit, confirm, dispute)
- k6/stellar-sim.js: simulates Stellar RPC interactions (account lookup, tx
  simulation, submission, status polling)
- k6/options.js: shared configurations for load, soak, and stress test profiles
- k6/README.md: usage documentation

Issue: KingFRANKHOOD#293
- tests/e2e/wallet-connect.spec.ts: wallet connection via Freighter, JWT
  storage, authenticated page access
- tests/e2e/trade-lifecycle.spec.ts: full lifecycle (create trade, deposit,
  confirm delivery, dispute, combined end-to-end)
- tests/e2e/dispute-resolution.spec.ts: mediator dashboard, dispute resolution
  with equal split, evidence submission
- Updated playwright.config.ts to include tests/e2e in the test directory

Covers: connect wallet, create trade, deposit, confirm delivery, dispute
- state_machine_fuzz_tests.rs includes 6 new property-based fuzz modules:
  1. prop_state_machine_random_ops: random sequence of lifecycle operations
  2. prop_fuzz_addresses_in_create_trade: invalid/self-referencing addresses
  3. prop_storage_integrity_rapid_transitions: rapid state transitions
  4. prop_resolve_dispute_fuzz: all loss-sharing param combinations
  5. prop_boundary_fuzz: edge-case amounts with extreme fee rates
  6. prop_many_trades_rapid_creation: rapid multi-trade creation & counters

Builds on existing QuickCheck infrastructure (bps_fuzz_tests.rs)
- frontend/tests/pact/trades.pact.test.ts: consumer-side Pact tests covering
  all trades API endpoints (create, deposit, confirm, release, dispute,
  get, list, stats) using PactV3 + MatchersV3
- backend/src/__tests__/trades.pact.verify.test.ts: provider-side verification
  against generated pact files with state handlers
- Installed @pact-foundation/pact v17 in both frontend and backend

This establishes the contract testing pipeline between frontend (consumer)
and backend (provider) for the trades API.
@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@Sundriveauto Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…check

- Downgrade @pact-foundation/pact from v17 to v16 (requires Node >=20, CI uses Node 20)
- Regenerate npm package-lock.json files for frontend and backend
- Add pnpm.onlyBuiltDependencies config for @pact-foundation/pact-core
- Fix contract deployment safety check regex to accept cdylib+rlib crate-type
- Replace iso8601DateTimeWithMillis with datetime matcher (v3 API compat)
- Change all CI gates (frontend, backend, mobile) from npm ci to
  pnpm install --frozen-lockfile (project uses pnpm as package manager)
- Use pnpm/action-setup for pnpm bootstrapping and pnpm caching
- Remove npm audit and lockfile verification steps (not applicable with pnpm)
- Fix contract deployment safety check regex to accept both
  ['cdylib', 'rlib'] and ['rlib'] crate-type formats
@KingFRANKHOOD KingFRANKHOOD merged commit c7e425c into KingFRANKHOOD:main Jun 30, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add API contract tests with Pact Add fuzz testing for contract functions Add e2e test suite with Playwright Add load testing script suite

2 participants